import java.util.Arrays;

public class Test {
    public static void rotate(int[] nums, int k) {
        for(int j = 0;j<k;j++){
            int a = nums[0];
            for(int i = 0;i<nums.length - 1;i++){
                nums[i] = nums[i+1];
            }
            nums[nums.length-1] = a;
        }
        System.out.println(Arrays.toString(nums));

    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6,7};
        rotate(array,3);
    }
}
